package com.mjh.zhujianju.enums;

/**
 * @author: Alex
 * @version: V1.0
 * @project: zhujianju
 * @package: com.mjh.zhujianju.enums
 * @description: description
 * @date: 2018/8/19
 * @time: 上午11:01
 */
public enum BuildClassEnum {

    TYPE_DZ("1","党章党规"),
    TYPE_XJP("2","习近平讲话"),
    TYPE_SJD("3","十九大精神"),
    TYPE_SHYK("4","三会一课"),
    TYPE_ZDZG("5","治党治国"),
    TYPE_DS("6","党史");

    private String code;
    private String name;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    BuildClassEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static BuildClassEnum[] getEnums(){
        return BuildClassEnum.values();
    }

    public static String getName(String code){
        if(code == null){
            return null;
        }

        for (BuildClassEnum buildClassEnum : BuildClassEnum.values()){
            if(code.equals(buildClassEnum.getCode())){
                return buildClassEnum.getName();
            }
        }

        return null;
    }
}
